<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>登录</title>

		<meta name="description" content="login" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="${ctxPath!}/static/bootstrap/bootstrap.min.css" />
		<link rel="stylesheet" href="${ctxPath!}/static/css/font-awesome.min.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="${ctxPath!}/static/ace/css/ace.min.css" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="${ctxPath!}/static/ace/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="${ctxPath!}/static/ace/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="${ctxPath!}/static/ace/css/ace-ie.min.css" />
		<![endif]-->

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="${ctxPath!}/static/bootstrap/html5shiv.min.js"></script>
		<script src="${ctxPath!}/static/bootstrap/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="login-layout blur-login">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container" style="padding-top: 60px;">
							<div class="center">
								<h1>
									<span class="red" id="id-text2">zsCat正式分布式管理系统</span>
								</h1>
								<h4 class="blue" id="id-company-text">&copy; zsCat</h4>
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger" id="msg">
												<i class="ace-icon fa fa-coffee green"></i>
												优等的心,不必华丽,但必须坚固
											</h4>

											<div class="space-6"></div>

											<form id="login-form" action="${ctxPath}/login" method="post">
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" name="username" placeholder="用户名" autocomplete="off"
															datatype="*" value="admin"  nullmsg="请输入用户名！" data-error="用户名或密码错误"/>
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" name="password" placeholder="密码" autocomplete="off"
															datatype="*" value="admin" nullmsg="请输入密码！"/>
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>
													
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control width-55 pull-left" name="code" placeholder="验证码" autocomplete="off"
															datatype="*"  nullmsg="请输入验证码！" data-error="验证码错误"/>
															<img src="${ctxPath!}/captcha?width=120&height=32" onclick="javascript:refresh(this);" id="code"
															class="pull-right" title="点击换一张" style="cursor: pointer;border: 1px solid rgb(181, 181, 181);"/>
														</span>
													</label>

													<div class="space"></div>

													<div class="clearfix">
														<span type="button" class="width-100 pull-right btn btn-primary" id="login-btn">
															<i class="ace-icon fa fa-key"></i>
															<span class="bigger-115">登&nbsp;录</span>
														</span>
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>
										</div><!-- /.widget-main -->

										<div class="toolbar clearfix">
											<div style="width: 100%;text-align: center;">
												<a href="javascript:void(0);" class="forgot-password-link bigger-130" style="text-decoration: none;">
													<i class="ace-icon fa fa-arrow-left"></i>
													提醒：请保护好您的账号和密码!
													<i class="ace-icon fa fa-arrow-right"></i>
												</a>
											</div>
										</div>
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->
							</div><!-- /.position-relative -->

						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="${ctxPath!}/static/jquery/jquery-2.1.1.min.js"></script>
		<!-- <![endif]-->

		<!--[if IE]>
		<script src="${ctxPath!}/static/jquery/jquery-1.11.1.min.js"></script>
		<![endif]-->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='${ctxPath!}/static/jquery/jquery.min.js'>"+"<"+"/script>");
		</script>
		<!-- <![endif]-->

		<!--[if IE]>
		<script type="text/javascript">
		 window.jQuery || document.write("<script src='${ctxPath!}/static/jquery/jquery1x.min.js'>"+"<"+"/script>");
		</script>
		<![endif]-->
		
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='${ctxPath!}/static/jquery/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>

		<script type="text/javascript" src="${ctxPath!}/static/layer/layer.min.js"></script>
		<script type="text/javascript" src="${ctxPath}/static/validate/Validform_v5.3.2_min.js"></script>

		<script type="text/javascript">
			function refresh(obj) {
		        obj.src = "${ctxPath!}/captcha?width=120&height=32&"+Math.random();
		    };

			jQuery(function($) {
				$("#login-form").Validform({
					btnSubmit:"#login-btn",
					ajaxPost:true,
					beforeSubmit:function(curform){
						$("#login-btn").attr("disabled","disabled").find("span").text("登录中…");
					},
					callback:function(data){
						if(undefined != data.error){
							$("#login-btn").removeAttr("disabled").find("span").text("登 录");
							var obj = $("#login-form input[data-error='"+data.error+"']");
							layer.tips(data.error,obj, {
								guide:0,
								time: 4,
								style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
							});
						}else{
							window.location.href = "${ctxPath!}/index";
						}
					},
					tiptype : function(msg, o, cssctl) {
						if (!o.obj.is("form")) {
							if (o.type != 2) {
								layer.tips(msg, o.obj, {
									guide:3,
									time: 4,
									style : ['background-color:#F26C4F; color:#fff','#F26C4F' ],
								});
							}
						}
					},
					tipSweep : true
				});
				
				$("#login-form").keydown(function(e){
					 var e = e || event,
					 keycode = e.which || e.keyCode;
					 if (keycode==13) {
					  $("#login-btn").trigger("click");
					 }
				});
				
			});
		</script>
	</body>
</html>
